/********************************************************************************
 * Copyright (c)2016-2020, ShenZhen WanJiaAn Technology CO.,LTD.
 * All Rights Reserved.
 *
 * File Name     : DevFlash.h
 * Author        : joki.zhu
 * Date          : 2019-10-28
 *
 * Record        :
 * 1.Date        : 2019-10-28
 *   Author      : joki.zhu
 *   Modification: Created file
 ********************************************************************************/

#ifndef __DEVFLASH_H__
#define __DEVFLASH_H__


#ifdef __cplusplus
#if __cplusplus
extern "C"{
#endif
#endif /* __cplusplus */

typedef struct {
    int (*flash_erase)(int fd, unsigned long startaddr, unsigned long length);
    int (*flash_write)(int fd, void *databuf, unsigned long startaddr, unsigned long length);
    int (*flash_read)(int fd, void *databuf, unsigned long startaddr, unsigned long length);
}FLASH_OPS_FUNC_S;

typedef struct {
    FLASH_OPS_FUNC_S stFlashOpsFunc;
}FLASH_INFO_S;

int FlashInit(void);
FLASH_OPS_FUNC_S *FlashGetOpsHandle(void);
int FlashDeinit(void);

#ifdef __cplusplus
#if __cplusplus
}
#endif
#endif /* __cplusplus */


#endif /* __DEVFLASH_H__ */
